/**
 * 
 */
package com.kgcx.schedule.tools;

import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

import com.kgcx.core.utils.JsonUtil;
import com.kgcx.core.utils.LngLatUtil;

/**
 * @author 袁进勇
 *
 */
public class ScheduleReserveCfgTool {
    private static void buildScheduleReserveCfg() {
        Map<String, Object> domain = new LinkedHashMap<String, Object>();
        // domain.put("kid", 1);
        domain.put("city_id", 1);
        domain.put("auto_type", 1);
        // domain.put("create_id", 0);
        // domain.put("create_time", HelpUtil.getNowTime());
        // domain.put("update_id", 0);
        // domain.put("update_time", HelpUtil.getNowTime());
        domain.put("status", 101);

        List<Map<String, Object>> detailList = new ArrayList<Map<String, Object>>();
        domain.put("detailList", detailList);

        Map<String, Object> detail = new LinkedHashMap<String, Object>();
        detailList.add(detail);
        detail.put("begin_time", "00:00:00");
        detail.put("end_time", "02:00:00");
        detail.put("quantity", 5);

        detail = new LinkedHashMap<String, Object>();
        detailList.add(detail);
        detail.put("begin_time", "02:00:00");
        detail.put("end_time", "04:00:00");
        detail.put("quantity", 5);

        detail = new LinkedHashMap<String, Object>();
        detailList.add(detail);
        detail.put("begin_time", "04:00:00");
        detail.put("end_time", "06:00:00");
        detail.put("quantity", 5);

        detail = new LinkedHashMap<String, Object>();
        detailList.add(detail);
        detail.put("begin_time", "06:00:00");
        detail.put("end_time", "08:00:00");
        detail.put("quantity", 5);

        detail = new LinkedHashMap<String, Object>();
        detailList.add(detail);
        detail.put("begin_time", "08:00:00");
        detail.put("end_time", "10:00:00");
        detail.put("quantity", 5);

        detail = new LinkedHashMap<String, Object>();
        detailList.add(detail);
        detail.put("begin_time", "10:00:00");
        detail.put("end_time", "12:00:00");
        detail.put("quantity", 5);

        detail = new LinkedHashMap<String, Object>();
        detailList.add(detail);
        detail.put("begin_time", "12:00:00");
        detail.put("end_time", "14:00:00");
        detail.put("quantity", 5);

        detail = new LinkedHashMap<String, Object>();
        detailList.add(detail);
        detail.put("begin_time", "14:00:00");
        detail.put("end_time", "16:00:00");
        detail.put("quantity", 5);

        detail = new LinkedHashMap<String, Object>();
        detailList.add(detail);
        detail.put("begin_time", "16:00:00");
        detail.put("end_time", "18:00:00");
        detail.put("quantity", 5);

        detail = new LinkedHashMap<String, Object>();
        detailList.add(detail);
        detail.put("begin_time", "18:00:00");
        detail.put("end_time", "20:00:00");
        detail.put("quantity", 5);

        detail = new LinkedHashMap<String, Object>();
        detailList.add(detail);
        detail.put("begin_time", "20:00:00");
        detail.put("end_time", "22:00:00");
        detail.put("quantity", 5);

        detail = new LinkedHashMap<String, Object>();
        detailList.add(detail);
        detail.put("begin_time", "22:00:00");
        detail.put("end_time", "24:00:00");
        detail.put("quantity", 5);

        System.out.println(JsonUtil.toPrettyString(domain));
    }

    private static void distance() {
        double driverLat = 28.231346;
        double driverLng = 112.88249;

        double userLat = 28.226991;
        double userLng = 112.881063;

        System.out.println(LngLatUtil.getDistance(driverLat, driverLng, userLat, userLng).intValue());
    }

    public static void main(String[] args) {
        buildScheduleReserveCfg();
        distance();
    }
}
